<?php
include_once('common/header.php');	
$objVfriendUser	= new Vfriend_User();
$objBlog 		= new Blog();
$strValue		= '';
$intTotal		= 0;
$intLimit		= BLOG_LIMIT;
$intType		= $objRequest->getParam('sort', 1);	
$intPage		= $objRequest->getParam('page', 1);
$intOffset		= ($intPage - 1) * $intLimit;
if(!isset($intAjax)) {
	$intOwnerId	= $AppUI->id;
}
if($intType == 2) $strValue = $objVfriendUser->getRelation($intOwnerId);
elseif($intType == 5) $strValue = $intOwnerId;
$arrResult	= $objBlog->getAll($intOwnerId,$intType,$strValue,$intOffset,$intLimit,$intTotal);
$this->view->arrResult		= $arrResult;	
$this->view->intTotalPage	= ceil($intTotal / $intLimit);
$this->view->intPage 		= $intPage;
$this->view->intOwnerId		= $intOwnerId;
if(!isset($intAjax)) {
	$this->view->arrSort	= $AppUI->id > 0 ? $arrSort : $arrSortNo;	
	$this->view->intType	= $intType;	
	$this->view->arrTop		= $objBlog->getAll($AppUI->id,3,'',0,$intLimit);
}

?>